<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>forEach</title>
</head>
<body>
<script>
    var arr = ["王一", "王二", "王三"];
    arr.forEach(function(item, index, obj) {
        console.log("item:" + item);
        console.log("index:" + index);
        console.log("obj:" + obj);
        console.log("----------")
</script>
</body>
</html>